package viewmodel;

import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.ViewModel;
import android.support.annotation.NonNull;
import repository.BaseRepository;


public abstract class BaseViewModel<T extends BaseRepository>   extends ViewModel {

    protected abstract T getRepository();
    public void setLifecycleOwner(LifecycleOwner lifecycleOwner) {
        getRepository() .setLifecycleOwner(lifecycleOwner);
    }

    public T getLifecycleObserver() {
        return getRepository();
    }

}
